package com.gxa.eloan.service.impl;

import com.gxa.eloan.mapper.TxDepositsMapper;
import com.gxa.eloan.mapper.TxWithdrawsMapper;
import com.gxa.eloan.pojo.PageBean;
import com.gxa.eloan.pojo.TxDeposits;
import com.gxa.eloan.pojo.TxWithdraws;
import com.gxa.eloan.service.TxDepositsService;
import com.gxa.eloan.service.TxWithdrawsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("txDepositsService")
public class TxDepositsServiceImpl implements TxDepositsService {
    @Resource(name = "txDepositsMapper")
    private TxDepositsMapper txDepositsMapper;

    @Override
    public List<TxDeposits> slelectAll() {
        return txDepositsMapper.selectAll();
    }

    @Override
    public List<TxDeposits> selectRechargeId(Long rechargeid) {
        return txDepositsMapper.selectRechargeId(rechargeid);
    }

//    @Transactional(propagation = Propagation.SUPPORTS)//查询适合SUPPORTS  增删改适合用REQUIRED
//    @Override
//    public PageBean<TxDeposits> selectByPage(int page, int limit) {
//        List<TxDeposits> txDeposits = txDepositsMapper.selectByPage((page - 1) * limit, limit);
//        int i = txDepositsMapper.selectCount();
//        PageBean<TxDeposits> pageBean = new PageBean<>();
//        pageBean.setPageBean(txDeposits);
//        pageBean.setCount(i);
//        return pageBean;
//    }
//
//    /**
//     * 这是查询需要审核的方法
//     * @param page
//     * @param limit
//     * @return
//     */
//    @Transactional(propagation = Propagation.REQUIRED)
//    @Override
//    public PageBean<TxDeposits> selectByStatus(int page, int limit) {
//        List<TxDeposits> txDeposits = txDepositsMapper.selectByStatus((page-1)*limit,limit);
//        int i = txDepositsMapper.selectCountStatus();
//        PageBean<TxDeposits> pageBean = new PageBean<>();
//        pageBean.setPageBean(txDeposits);
//        pageBean.setCount(i);
//        return pageBean;
//    }

}
